package cn.edu.zafu.bigdata.fui;

class StaticDemo {
    static int count;
    int id;
    static {
        System.out.println("Static Block Executed");
        count = 0;
    }
    {
        System.out.println("Instance Block Executed");
        id = ++count;
    }
    StaticDemo(){
        System.out.println("Constructor executed for ID:"+ id);
    }

    public static void displayCount(){
        System.out.println("Count:"+ count);
    }
}

public class TestStaticDemo{
    public static void main(String[] args) {
        StaticDemo demo1 = new StaticDemo();
        StaticDemo demo2 = new StaticDemo();
        StaticDemo demo3 = new StaticDemo();
        StaticDemo.displayCount();
    }
}